home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / fortran / toolpack.000 / toolpack / toolpack1.2 / scriptsource / dac.s < prev    next >
Encoding:
Text File  |  1993-10-04  |  2.2 KB  |  80 lines

  1. #! /bin/csh
  2. #  dac is a csh script to compare two data files using ISTDC.
  3. #
  4. #
  5. #  Invocation:
  6. #
  7. #  dac data_file_1 data_file_2 [n]
  8. #
  9. #  The optional parameter "n" is a positive integer indicating that
  10. #  two numbers in the data file are considered equal if their
  11. #  absolute difference is less than or equal to 1.0D-n.  If n is not
  12. #  specified, the default value n=6 is used.
  13. #
  14. #  Check command line validity.
  15. if ( $#argv < 2 ) then
  16. TOOLPACKPATH/toolpack1.2/util/echoerr \
  17. Invocation:
  18. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  19. TOOLPACKPATH/toolpack1.2/util/echoerr \
  20. "dac data_file_1 data_file_2 [n]"
  21. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  22. TOOLPACKPATH/toolpack1.2/util/echoerr \
  23. 'The optional parameter "n" is a positive integer indicating that '
  24. TOOLPACKPATH/toolpack1.2/util/echoerr \
  25. two numbers in the data files are considered equal if their
  26. TOOLPACKPATH/toolpack1.2/util/echoerr \
  27. absolute difference is less than or equal to 1.0D-n.  If n is not
  28. TOOLPACKPATH/toolpack1.2/util/echoerr \
  29. specified, the default value n=6 is used.
  30. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  31. TOOLPACKPATH/toolpack1.2/util/echoerr \
  32. A report is sent to standard output and may be redirected to a file.
  33. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  34.    exit
  35. endif
  36. #  Check that data_file_1 exists.
  37. if ( -e $1 == 0 ) then
  38. TOOLPACKPATH/toolpack1.2/util/echoerr \
  39. "'$1' does not exist."
  40.    exit
  41. endif
  42. #  Check that data_file_2 exists.
  43. if ( -e $2 == 0 ) then
  44. TOOLPACKPATH/toolpack1.2/util/echoerr \
  45. "'$2' does not exist."
  46.    exit
  47. endif
  48. #
  49. #  Create PFS.  If PFS already exists, exit with an advisory message.
  50. #
  51. if ( -e _.TOOLPACK == 0 ) then
  52.    mkdir _.TOOLPACK
  53. else
  54. TOOLPACKPATH/toolpack1.2/util/echoerr \
  55. Toolpack-created directory '"_.TOOLPACK"' exists. \
  56. Remove with script '"discard"'.
  57.    exit
  58. endif
  59. #  Make a tab-free copy of data_file_1.
  60. set file1 = $1
  61. expand $1 > _.TOOLPACK/$file1
  62. #  Make a tab-free copy of data_file_2.
  63. set file2 = $2
  64. expand $2 > _.TOOLPACK/$file2
  65. #  Create the interprocess file IST.CMD and append parameters for ISTDC.
  66. if ( $#argv == 3 ) then
  67. TOOLPACKPATH/toolpack1.2/util/mkipf \
  68. $file1 $file2 \#1 T2=1.0D-$3 H
  69. else
  70. TOOLPACKPATH/toolpack1.2/util/mkipf \
  71. $file1 $file2 \#1 H
  72. endif
  73. #
  74. #  Invoke ISTDC.
  75. #
  76. TOOLPACKPATH/toolpack1.2/exec/istdc.u
  77. #
  78. /bin/rm -r _.TOOLPACK
  79. #
  80.